Fold (higher-order function)
FAMILY OF HIGHER-ORDER FUNCTIONS THAT ANALYZE A RECURSIVE DATA STRUCTURE AND BUILD UP A RETURN VALUE
Foldl; Foldr; Right fold; Left fold; Reduce (higher-order function); Fold function; Fold (higher order function); Accumulate (higher-order function); Fold (function); Reduce function; FoldLeft; FoldRight
In functional programming, fold (also termed reduce, accumulate, aggregate, compress, or inject) refers to a family of higher-order functions that analyze a recursive data structure and through use of a given combining operation, recombine the results of recursively processing its constituent parts, building up a return value. Typically, a fold is presented with a combining function, a top node of a data structure, and possibly some default values to be used under certain conditions.